var exec = require("child_process").exec ; //获取child_process exec 方法 
var querystring=require("querystring"); 
var fs = require('fs');

function start(response){

	var html = fs.readFile('./html/upload.html', function (err, data) {
			    if (err) return console.error(err);
			   	    response.writeHead(200,{"Content-Type":"text/html"});
				    response.write( data.toString() );
				    response.end();
			});
	console.log('处理start请求被唤醒');
}

function upload(response , postData){
	console.log("处理'upload'请求已被唤醒！");
	response.write('提交的文本：' + querystring.parse(postData).text );
	response.end(); 
}

//开放API
exports.start = start ; 
exports.upload = upload ; 